<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"  
                xmlns:h="http://java.sun.com/jsf/html"  
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./../templates/FoodSageTemplate.xhtml">

    <ui:define name="logout">
        <p:commandLink id="logoutLink" actionListener="#{touristLogoutManagedBean.doLogout}" value="#{bundle['login.logout.label']}" ajax="false" immediate="true" />
    </ui:define>

    <ui:define name="main_menu">
        <f:view beforePhase="#{itineraryChooseItineraryTypeManagedBean.initView}"/>
        <p:menubar model="#{itineraryChooseItineraryTypeManagedBean.touristMainMenuModel}"/>
    </ui:define>

    <ui:define name="nav_menu">
        <p:menu model="#{itineraryChooseItineraryTypeManagedBean.touristNavMenuModel}"/>
    </ui:define>

    <ui:define name="content">
        <f:view beforePhase="#{reservationManagerBean.initReservationList}"></f:view>  
        <h:form id="formMain">
            <p:panel header="View All Reservation">
                <p:accordionPanel autoHeight="false">
                    <p:tab title="F and B Branches">
                        <p:dataTable var="reservation" value="#{reservationManagerBean.listOfReservation}" paginator="true" 
                                     rows="10" emptyMessage="No F and B Reservation"
                                     selectionMode="single" rowSelectListener="#{reservationManagerBean.onRowSelectNavigateSeeReservationInfo}">
                            <p:column sortBy="#{reservation.branch.name}" filterBy="#{reservation.branch.name}">
                                <f:facet name="header">
                                    <h:outputText value="Username" />
                                </f:facet>
                                <h:outputText value="#{reservation.branch.name}" />
                            </p:column>
                            <p:column sortBy="#{reservationManagerBean.getFormatReservedTime(reservation.timeBegin)}" filterBy="#{reservationManagerBean.getFormatReservedTime(reservation.timeBegin)}">
                                <f:facet name="header">
                                    <h:outputText value="Corporate name" />
                                </f:facet>
                                <h:outputText value="#{reservationManagerBean.getFormatReservedTime(reservation.timeBegin)}" />
                            </p:column>
                            <p:column sortBy="#{reservationManagerBean.getFormatReservedDate(reservation.dateReserved) }" filterBy="#{reservationManagerBean.getFormatReservedDate(reservation.dateReserved) }">
                                <f:facet name="header">
                                    <h:outputText value="Corporate name" />
                                </f:facet>
                                <h:outputText value="#{reservationManagerBean.getFormatReservedDate(reservation.dateReserved)}" />
                            </p:column>
                            <p:column sortBy="#{reservation.noOfPeople}" filterBy="#{reservation.noOfPeople}">
                                <f:facet name="header">
                                    <h:outputText value="Username" />
                                </f:facet>
                                <h:outputText value="#{reservation.noOfPeople}" />
                            </p:column>
                        </p:dataTable>
                    </p:tab>
                    <p:tab title="Event Branch">

                    </p:tab> 
                </p:accordionPanel> 
            </p:panel>
        </h:form>
    </ui:define>
</ui:composition>